<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1,user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="320">
<meta name="screen-orientation" content="portrait">
<meta name="x5-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="browsermode" content="application">
<meta name="x5-page-mode" content="app">
<meta name="msapplication-tap-highlight" content="no">
<title></title>
<link rel="stylesheet" type="text/css" href="/layui/css/layui.css"  media="all">
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<link rel="stylesheet" href="/groupbuying/css/index.css"/>
<script type="text/javascript" src="/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/layui-post.js"></script>
<style>
.mygroup-buying{position: relative;}
.joingroup-buying{position: relative;}
.mygroup-buying::after{
    content: "开团";
    position: absolute;
    top: 30px;
    right: -12px;
    width: 60px;
    height: 20px;
    transform: rotate(45deg);
    transform-origin: top right;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 16px solid #ed3636;
    font-size: 10px;
    text-align: center;
    line-height: 24px;
}
.joingroup-buying::after{
    content: "参团";
    position: absolute;
    top: 30px;
    right: -12px;
    width: 60px;
    height: 20px;
    transform: rotate(45deg);
    transform-origin: top right;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 16px solid #ed367d;
    font-size: 10px;
    text-align: center;
    line-height: 24px;
}
</style>
</head>
<body style="background-color: #f2f2f2;">
<nav class="navbar index-nav">
    <div class="loca ng-scope title-order" style="background: #f9fafd;">
        <a class="title-top" href="javascript:window.history.back();"></a>
        <a class="title-center">我的拼团</a>
        <a class="title-right" href="/index"></a>
    </div>
</nav>
<div id="user-b">
    <!-- 我的拼团列表 -->
    <div class="groups-box"></div>
</div>
</body>
<script type="text/javascript">
$.ajaxSetup({contentType: "application/json; charset=utf-8"});
var userInfo = $.parseJSON(sessionStorage.getItem("userInfo")),enumsData=[];
layui.use(['layer','form','element','util'], function(){
    // layui.util.fixbar({
    //     top:true,css: { right: 15, bottom: 105 },showHeight:100,
    //     click: function (type) {if (type === 'top') $('.layui-fluid').animate({scrollTop: 0}, 200);}
    // });
    var loading = layer.load(0, {shade: 0.1});
    //我的开团
    $.post("/cateringGroupBuying/select",JSON.stringify({userId:userInfo.userId,orderByType:"createTime"}), function (res) {
        layer.closeAll()
        $(".am-slides").empty()
        for(var i in res.data){
            $(".groups-box").append(
                '<div class="groups-m mc-sum-box">' +
                '<div><div class="myorder-sum fl"><img src="'+res.data[i].goodsImg+'"></div>' +
                '<div class="myorder-text mygroup-buying"><h1>'+res.data[i].actiName+' </h1>' +
                '<h2>规格：'+res.data[i].goodsWeight+'</h2><div class="tuan_g_core">' +
                '<div class="tuan_g_price"><span>成团价</span><b>¥'+res.data[i].actiPrice+'</b></div>' +
                '<div class="tuan_g_btn"></div></div></div></div><div class="groups-dowm-bnt">'+getStatus(res.data[i].status)+
                '<a href="/buyingdetail?sysId='+res.data[i].sysId+'" class="btn fr">查看团详情</a></div></div>'
            )
        }
    })
    //我参与的
    $.post("/cateringGroupInvitations/selectBuying",JSON.stringify({inviteeId:userInfo.userId,orderByType:"createTime"}), function (res) {
        layer.closeAll()
        $(".am-slides").empty()
        for(var i in res.data){
            $(".groups-box").append(
                '<div class="groups-m mc-sum-box">' +
                '<div><div class="myorder-sum fl"><img src="'+res.data[i].goodsImg+'"></div>' +
                '<div class="myorder-text joingroup-buying"><h1>'+res.data[i].actiName+' </h1>' +
                '<h2>规格：'+res.data[i].goodsWeight+'</h2><div class="tuan_g_core">' +
                '<div class="tuan_g_price"><span>成团价</span><b>¥'+res.data[i].actiPrice+'</b></div>' +
                '<div class="tuan_g_btn"></div></div></div></div><div class="groups-dowm-bnt">'+getStatus(res.data[i].status)+
                '<a href="/buyingdetail?sysId='+res.data[i].sysId+'" class="btn fr">查看团详情</a></div></div>'
            )
        }
    })
})
function getStatus(s){
    return (s == 1 ? "拼团进行中" : (s == 2 ? "拼单已成团" : "拼团已失败"))
}
</script>
<script type="text/javascript" src="/groupbuying/js/bottom-menu.js"></script>
</html>